<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> 后台管理开发框架</title>
<link href="/favicon.ico" rel="icon">
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="/static/admin/layui/css/layui.css" rel="stylesheet" type="text/css" />
<link href="/static/admin/css/style.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- // 重定位style -->
<link href="__STATICADMIN__css/content.css?" rel="stylesheet" type="text/css" />
<div class="layui-fluid">

    <form class="layui-form layui-card" >
        <div class="layui-card-body">
	        <gt name="$data.id" value="0">
	            <input type="text" name="id" value="{$data.id}" hidden="">
	            <else/>
	            <input type="text" name="id" value="" hidden="">
	        </gt>
            <div class="layui-tab layui-tab-brief"  >
                <ul class="layui-tab-title">
                  <li class="layui-this">编辑视频</li>
                  <li>SEO设置</li>
                  <li>高级选项</li>
                </ul>
                <div class="layui-tab-content" >
		            <div class="layui-tab-item layui-show">

		            	<div class="layui-form-item layui-form-video" >
		                    <gt name="$data.id" value="0"><input type="text" name="id" value="{$data.id}" hidden=""></gt>
		                    <input type="text" value="{$data.cid}" name="cid"  hidden="">
		                    <input type="text" value="{$data.pid}" name="pid"  hidden="">
		                    <input type="text" value="{$data.hash}" name="hash"  hidden="">

		                    <label class="layui-form-label">视频名称</label>
		                    <div class="layui-input-inline" >
		                        <input type="text" name="title" autocomplete="off" value="{$data.title}" class="layui-input">
		                    </div>
		                    <label class="layui-form-label">视频分类</label>
							<div class="layui-input-inline" >
								<div id="pid"></div>
							</div>
							<div class="layui-input-inline" >
							  <select name="status">
							    <option value="1" <if condition="$data['status'] eq 1">selected</if> >显示</option>
							    <option value="0" <if condition="$data['status'] eq 0">selected</if> >隐藏</option>
							  </select>
							</div>
							<div class="layui-input-inline" >
		                      <select name="language">
		                        <option value="">对白</option>
	                            <salibs:language id="vo">
	                            <option value="{$vo}" <if condition="$vo eq $data['language']">selected</if> >{$vo}</option>  
	                            </salibs:language> 
		                      </select>
							</div>
		                    <label class="layui-form-label" >影片时长</label>
		                    <div class="layui-input-inline" >
		                        <input type="text" name="minutes" placeholder="单位为分钟" value="{$data.minutes}" class="layui-input">
		                    </div>

		                </div>

						<div class="layui-form-item layui-form-video">
		                    <label class="layui-form-label">影片别名</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="alias" autocomplete="off" value="{$data.alias}" class="layui-input">
		                    </div> 
		                    <label class="layui-form-label">首映地区</label>
		                    <div class="layui-input-inline" >
		                      <select name="area">
		                        <option value="">出产地区</option>
	                            <salibs:arealist id="vo">
	                            <option value="{$vo}" <if condition="$vo eq $data['area']">selected</if> >{$vo}</option> 
	                            </salibs:arealist> 
		                      </select>
		                    </div>                     
		                    <div class="layui-input-inline" >
		                      <select name="year">
		                        <option value="">年代</option>
	                            <salibs:yearlist id="vo">
	                            <option value="{$vo}" <if condition="$vo eq $data['year']">selected</if> >{$vo}</option> 
	                            </salibs:yearlist> 
		                      </select>
		                    </div>  
		                    <div class="layui-input-inline"  >
		                      <select name="isfilm">
							    <option value="1" <if condition="$data['isfilm'] eq 1">selected</if> >已上映</option>
							    <option value="0" <if condition="$data['isfilm'] eq 0">selected</if> >未上映</option>
		                      </select>
		                    </div> 
		                    <label class="layui-form-label">播出周期</label>
		                    <div class="layui-input-inline" >
		                        <select name="weekday">
		                        <option value="">选择周期</option>
	                            <salibs:weeklist id="vo">
	                            <option value="{$vo}" <if condition="$vo eq $data['weekday']">selected</if> >{$vo}</option> 
	                            </salibs:weeklist> 		                         
		                      </select>
		                    </div> 
		                </div>

		                <div class="layui-form-item layui-form-video">
		                    <label class="layui-form-label" >影片简述</label>
		                    <div class="layui-input-inline" style="z-index: 999">
		                        <input type="text" name="desc" autocomplete="off" value="{$data.desc}" class="layui-input">
		                    </div> 
		                    <label class="layui-form-label" >影片状态</label>
		                    <div class="layui-input-block">
		                        <input type="checkbox" value="1" name="attribute[1]"  <in name="1" value="$data.attribute"> checked </in> title="首页推荐" >
		                        <input type="checkbox" value="2" name="attribute[2]"  <in name="2" value="$data.attribute"> checked </in> title="正在热映"  >
		                        <input type="checkbox" value="3" name="attribute[3]"  <in name="3" value="$data.attribute"> checked</in> title="卫视同步" >
		                        <input type="checkbox" value="4" name="attribute[4]"  <in name="4" value="$data.attribute"> checked</in> title="即将上映">
		                        <input type="checkbox" value="5" name="attribute[5]"  <in name="5" value="$data.attribute"> checked</in> title="锁定">     
		                    </div>                                         
		                </div>

		                <div class="layui-form-item layui-form-video">
		                    <label class="layui-form-label">影片主演</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="actor" placeholder="主演" value="{$data.actor}" class="layui-input">
		                    </div>  
		                    <label class="layui-form-label" >影片标签</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="class" placeholder="科幻，战争" value="{$data.class}" class="layui-input">
		                    </div>  
		                    <div class="layui-input-inline">
		                        <input type="text" name="continu" placeholder="当前连载" value="{$data.continu}" class="layui-input">
		                    </div> 

		                    <div class="layui-input-inline">
		                        <input type="text" name="total" placeholder="总集数" value="{$data.total}" class="layui-input">
		                    </div> 		          		                 
 
		                    <label class="layui-form-label" >备注信息</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="marks" placeholder="备注信息" value="{$data.marks}" class="layui-input">
		                    </div>                                     
		                </div>

		                <div class="layui-form-item layui-form-fixday">
		                    <label class="layui-form-label">影片导演</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="director" placeholder="导演" value="{$data.director}" class="layui-input">
		                    </div>  
  
		                    <label class="layui-form-label" >上映日期</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="filmtime" placeholder="yyyy-MM-dd" lay-datetime value="{$data.filmtime}" class="layui-input">
		                    </div> 
		                    <label class="layui-form-label" >更新日期</label>
		                    <div class="layui-input-inline">
		                        <input type="text" value="{$data.updatetime|default=''}" class="layui-input">
		                    </div>                                        
		                </div>	                
		                <div class="layui-form-item">
		                    <label class="layui-form-label" >微缩图</label>
		                    <div class="layui-input-inline wid550" >
		                        <input type="text" name="thumb" placeholder="请上传微缩图" lay-image-hover="" value="{$data.thumb}" class="layui-input thumb">
		                    </div>   
		                    
		                    <button type="button" class="layui-btn" lay-upload="" lay-input="thumb" >上传图片</button>
		                </div> 

		                <div class="layui-form-item">
		                    <label class="layui-form-label" >海报剧照</label>
		                    <div class="layui-input-inline wid550" >
		                        <input type="text" name="image" lay-image-hover="" 
		                        placeholder="请上传影片剧照" value="{$data.image}" class="layui-input image">
		                    </div>   

		                    <button type="button" class="layui-btn" lay-upload="" lay-input="image" >上传封面</button>
		                </div> 
		                <div class="layui-form-item">
		                    <label class="layui-form-label" >首页幻灯片</label>
		                    <div class="layui-input-inline wid550" >
		                        <input type="text" name="banner" lay-image-hover="" 
		                        placeholder="请上传幻灯片" value="{$data.banner|default=''}" class="layui-input banner">
		                    </div>   
		                    <button type="button" class="layui-btn" lay-upload="" lay-input="banner" >上传幻灯片</button>
		                </div>  
		                <div id="player_list" class="layui-player-list">
		                <notempty name="data['play']">
		                    <volist name="data['play']" id="vo" key="key">
			                    <?php $parent_key = $key; ?>
			                    <div class="layui-form-item" data-i="{$key}" >
			                        <label class="layui-form-label" >播放地址{$key}</label>
			                        <div class="layui-input-inline" >
			                          <select name="play[{$parent_key}]" data-player>
			                            <option value="">请选择播放器</option>
			                            <salibs:playlist id="play">
			                            <option value="{$play.name}" <if condition="$play.name eq $vo">selected</if> >{$play.title}</option>
			                            </salibs:playlist> 
			                          </select>
			                        </div>

			                        <div class="layui-input-inline">
			                          <select name="server[{$parent_key}]" data-server>
			                            <option value="">请选择服务器</option>
			                            <salibs:serverlist id="server">
			                            <option value="{$server.name}" <notempty name="$data['server'][$parent_key-1]"> <if condition="$server.name eq $data['server'][$parent_key-1]">selected</if> </notempty> >{$server.title}</option>
			                            </salibs:serverlist>
			                          </select>
			                        </div>

			                        <div class="layui-input-inline">
			                            <input type="text" name="note[{$parent_key}]" placeholder="请输入备注"  class="layui-input" 
			                            <notempty name="$data['note'][$parent_key-1]"> value="{$data['note'][$parent_key-1]}" </notempty> >
			                        </div>
			                        <p class="layui-clear"></p>
			                        <!-- 循环输出每个播放数据 -->
			                        <div class="layui-input-block layui-data-urls"> 
			                            <textarea name="url[{$parent_key}]" class="layui-textarea" >{$data.url[($parent_key-1)]}</textarea>
			                        </div>                                                                                        
			                    </div>
		                    </volist>
	                    </notempty>
	                	</div>

	                	<div class="layui-form-item">
			                <div class="layui-input-inline" >
			                    <label class="layui-form-label" ></label>
			                    <button type="button" class="layui-btn" id="layui-add-play">增加一组播放</button>
			                </div> 
		            	</div>

		                <div class="layui-form-item">
		                    <label class="layui-form-label">详细介绍</label>
		                    <div class="layui-input-block">
		                        <textarea id="content" name="content" class="layui-hide">{$data.content}</textarea>
		                    </div>
		                </div>
		                          
		            </div>

					<div class="layui-tab-item">
		                <div class="layui-form-item">
		                    <label class="layui-form-label">独立模板</label>
		                    <div class="layui-input-inline">
		                    	<select name="skin">
		                    		<option value=""></option>
		                    		<salibs:customtpl id="vo">
		                    		<option value="{$vo}" <if condition="$vo eq $data['skin']"> selected </if> >{$vo}</option>
		                    		</salibs:customtpl>
		                    	</select>
		                    </div>  		               
		                </div> 	
		                <div class="layui-form-item">
		                    <label class="layui-form-label" >SEO标题</label>
		                    <div class="layui-input-inline wid650">
		                        <input type="text" name="seo_title" placeholder="请输入SEO标题" value="{$data.seo_title}" class="layui-input">
		                    </div>                                          
		                </div>
		                <div class="layui-form-item">
		                    <label class="layui-form-label" >关键TAG</label>
		                    <div class="layui-input-inline wid650">
		                        <input type="text" name="seo_keywords" placeholder="请输入SEO关键词" value="{$data.seo_keywords}" class="layui-input">
		                    </div>                                          
		                </div>

		                <div class="layui-form-item">
		                    <label class="layui-form-label" >SEO简介</label>
		                    <div class="layui-input-inline wid650">
		                        <textarea name="seo_description" placeholder="请输入SEO描述信息" class="layui-textarea" >{$data.seo_description}</textarea>
		                    </div>                                          
		                </div>

		                <div class="layui-form-item" >
		                    <label class="layui-form-label" >采集来源</label>
		                    <div class="layui-input-inline wid650">
		                        <input type="text" name="reurl" placeholder="http://" value="{$data.reurl}" class="layui-input">
		                    </div>
		                </div>
		                <div class="layui-form-item" >
		                    <label class="layui-form-label" >跳转地址</label>
		                    <div class="layui-input-inline wid650">
		                        <input type="text" name="jumpurl" placeholder="https://" value="{$data.jumpurl}" class="layui-input">
		                    </div>
		                </div>	           
					</div>


                    <div class="layui-tab-item">
		                <div class="layui-form-item">
		                    <label class="layui-form-label">推荐星级</label>
		                    <div class="layui-input-inline">
		                        <input class="stars" type="text" name="stars" value="{$data.stars}"  hidden="" >
		                        <div lay-stars="ones" lay-value="{$data.stars}" lay-class="stars" lay-theme="#1890ff" ></div>
		                    </div>
		                    <label class="layui-form-label">标题颜色</label>
		                    <div class="layui-input-inline">
		                        <input class="color" type="text" name="color" value="{$data.color}"  hidden="" >
		                        <div class="picker" lay-colorpicker="color" lay-value ="{$data.color}" ></div>
		                    </div>
		                </div>	

		                <div class="layui-form-item">
		                    <label class="layui-form-label">浏览权限</label>
		                    <div class="layui-input-inline">
		                    	<div id="access"></div>
		                    </div>
		                    <label class="layui-form-label">文章排序</label>
		                    <div class="layui-input-inline">
								<input type="number" name="sort" class="layui-input" value="{$data.sort}" >
		                    </div>                    
		                </div>

		                <div class="layui-form-item">
		                    <label class="layui-form-label">所需积分</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="score" autocomplete="off" value="{$data.score}" class="layui-input">
		                    </div>  		                
		                    <label class="layui-form-label">首字母</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="letter" autocomplete="off" value="{$data.letter}" class="layui-input">
		                    </div>
                  
		                </div>

		                <div class="layui-form-item">
		                    <label class="layui-form-label">日人气</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="hits_day" autocomplete="off" value="{$data.hits_day}" class="layui-input">
		                    </div>
		                    <label class="layui-form-label">周人气</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="hits_week" autocomplete="off" value="{$data.hits_week}" class="layui-input">
		                    </div>                    
		                </div>    

		                <div class="layui-form-item">
		                    <label class="layui-form-label">月人气</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="hits_month" autocomplete="off" value="{$data.hits_month}" class="layui-input">
		                    </div>
		                    <label class="layui-form-label">总人气</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="hits" autocomplete="off" value="{$data.hits}" class="layui-input">
		                    </div>                    
		                </div>                
		            
		                <div class="layui-form-item">
		                    <label class="layui-form-label">评分值</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="gold" autocomplete="off" value="{$data.gold}" class="layui-input">
		                    </div>
		                    <label class="layui-form-label">评分人数</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="golder" autocomplete="off" value="{$data.golder}" class="layui-input">
		                    </div>                    
		                </div>

		                <div class="layui-form-item">
		                    <label class="layui-form-label">顶一下</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="up" autocomplete="off" value="{$data.up}" class="layui-input">
		                    </div>
		                    <label class="layui-form-label">踩一下</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="down" autocomplete="off" value="{$data.down}" class="layui-input">
		                    </div>                    
		                </div>

		                <div class="layui-form-item">		               
		                    <label class="layui-form-label">录入编辑</label>
		                    <div class="layui-input-inline">
		                        <input type="text" name="author" placeholder="admin" value="{$data.author}" class="layui-input">
		                    </div>    
		                </div>		       
                    </div>
                </div>
          	</div>
        </div>
    
        <div class="layui-footer layui-form-footer" >
            <button class="layui-btn layui-btn-primary" type="button" pa-event="closeDialog">取消</button>
            <button class="layui-btn" lay-filter="submitIframe" lay-submit lay-reload="false" >提交</button>
        </div>
    </form>
</div>
<script src="/static/admin/layui/layui.js?v=1.0.0"></script>
<script src="/static/admin/js/common.js?v=1.0.0"></script>
<script src="/static/admin/module/xmselect/xmselect.js"></script>
<script src="/static/js/tinymce/tinymce.min.js"></script>
<script>
	var grouplist = {:get_usergroup_json()};
	var categorylist = {:get_category_json(0,3,'id,cid,pid,title')};
</script>

<!-- // 列表工具栏 -->
<script type="text/html" id="player">
    <option value="">请选择播放器</option>
    <salibs:playlist id="play">
    <option value="{$play.name}" >{$play.title}</option>
    </salibs:playlist> 
</script>

<script type="text/html" id="server">
	<option value="">请选择服务器</option>
	<salibs:serverlist id="server">
	<option value="{$server.name}" >{$server.title}</option>
	</salibs:serverlist> 
</script>

<script>
    layui.use(['admin','content'], function () {

        var jquery = layui.jquery;
        var admin = layui.admin;
        var content = layui.content;

        // 常规元素渲染
		content.tinymce('content');
		content.xmselect('pid',categorylist,[{$data.pid}],false);
		content.xmselect('access',grouplist,[{$data.access}]);

  		jquery('#layui-add-play').on('click',function(){
  			var player = jquery('*[data-i]');
  			player = player.length+1;
	        var player_select = jquery('#player').html();
	        var server_select =	jquery('#server').html();
  			var tpl='<div class="layui-form-item"data-i="'+player+'">';
  			tpl += '<label class="layui-form-label">播放地址'+(player)+'</label>';
  			tpl += '<div class="layui-input-inline"><select name="play['+(player)+']">'+player_select+'</select></div>';
  			tpl += '<div class="layui-input-inline"><select name="server['+(player)+']">'+server_select+'</select></div>';
  			tpl += '<div class="layui-input-inline"><input type="text"name="note[]"class="layui-input"placeholder="备注信息"></div>';
  			tpl += '<p class="layui-clear"></p>';
  			tpl += '<div class="layui-input-block layui-data-urls""><textarea name="url['+(player)+']" class="layui-textarea"></textarea></div></div>';
            jquery("#player_list").append(tpl);
  			layui.form.render();
  		})
    });
</script>
